<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<body>
	<ui:composition template="/template/template.xhtml">
		<ui:define name="title">Aqarat Index</ui:define>
		<ui:define name="manuBar">
			<ui:include src="/controlling/aqarat/aqaratMenu.xhtml" />
		</ui:define>

		<ui:define name="content">
			<h:form id="apartment_frm">

				<p:panel header="Apartment Details" style="text-align:center">
					<h:panelGrid columns="4">
						<h:outputText value="Building Name" />
						<p:selectOneMenu id="build" value="#{apartmentBean.building.recid}">
							<f:selectItem itemLabel="" value="-1" />
							<f:selectItems value="#{apartmentBean.buildingList}" var="build"
								itemLabel="#{build.name}" itemValue="#{build.recid}" />
							<f:ajax execute="@this" listener="#{apartmentBean.loadFloorList}" />
						</p:selectOneMenu>
						<p:selectOneMenu id="floor" value="#{apartmentBean.floor.recid}">
							<f:selectItem itemLabel="" value="-1" />
							<f:selectItems value="#{apartmentBean.floorList}" var="floor"
								itemLabel="#{floor.recid}" itemValue="#{floor.recid}" />
								<p:ajax update=""/>
							<f:ajax execute="@this" listener="#{apartmentBean.loadFloorList}" />
						</p:selectOneMenu>
					</h:panelGrid>
					
					
					<p:commandButton value="save"
						actionListener="#{aqaratIndexBean.saveBuilding}" />

				</p:panel>
			</h:form>
		</ui:define>
	</ui:composition>
</body>
</html>
